package com.dhcc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dhcc.entity.SysUsers;
import org.apache.ibatis.annotations.Mapper;

/**
 *  用户 Mapper 接口
 *
 * @ProjectName Dhcc-Cloud
 * @PackageName com.dhcc.mapper
 * @Title SysUserMapper.xml
 * @Date 2024/10/9 下午12:48
 * @Author LiuGuoting
 */
@Mapper
public interface SysUsersMapper extends BaseMapper<SysUsers> {

    /**
     * 根据用户名查询用户信息
     *
     * @param username 用户名
     * @return SysUser 用户实体
     */
    // @Select("SELECT user_id, user_name, user_password, " +
    //         "name, sex, birthday, address, phone, email, avatar, " +
    //         "login_ip, login_date, status, del_flag, " +
    //         "create_user, create_time, update_user, update_time " +
    //         "FROM sys_user WHERE user_name = #{username}")
    SysUsers getUserByUsername(String username);

    /**
     * 注册用户信息
     *
     * @param user 用户实体
     * @return 插入的行数
     */
    int registerUser(SysUsers user);

    SysUsers getUserInfo(String userId);

    Integer updateUserPositionByUserId(String userId, String positionId);
}